package com.joysuch.wwyt.common.controller;

import com.joysuch.wwyt.common.service.CommonFaceService;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author xsx
 * @version 1.0
 * @date 2023/3/16 9:51
 */
@RestController
@RequestMapping("/common/prtq/face-id")
public class CommonFaceController {

    @Autowired
    private CommonFaceService commonFaceService;


    @RequestMapping("compare")
    @ResponseBody
    @ApiOperation("人脸对比")
    public Object compare(MultipartFile file, Long userId) throws IOException {
        return commonFaceService.compare(file,userId);
    }

    @RequestMapping("search")
    @ResponseBody
    @ApiOperation("人脸搜索")
    public ResultBean search(MultipartFile file) {
        return commonFaceService.search(file);
    }

}
